<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{.title}}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link href="/static/css/toast.css" rel="stylesheet">
    <link href="/static/css/main.css" rel="stylesheet">
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <nav class="col-md-3 col-lg-2 d-md-block sidebar collapse">
                <div class="position-sticky pt-3">
                    <h5 class="sidebar-heading px-3 mt-4 mb-1 tech-line">
                        <i class="bi bi-cpu"></i> 数据迁移工具
                    </h5>
                    <ul class="nav flex-column">
                        <li class="nav-item">
                            <a class="nav-link {{if eq .active "migration"}}active{{end}}" href="/migration">
                                <i class="bi bi-diagram-3"></i> 迁移任务配置
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {{if eq .active "execution"}}active{{end}}" href="/execution">
                                <i class="bi bi-lightning"></i> 执行记录
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {{if eq .active "datasource"}}active{{end}}" href="/datasource">
                                <i class="bi bi-hdd-network"></i> 数据源管理
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {{if eq .active "template"}}active{{end}}" href="/template">
                                <i class="bi bi-filter-circle"></i> 过滤模板
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {{if eq .active "masking"}}active{{end}}" href="/masking">
                                <i class="bi bi-shield-check"></i> 脱敏规则
                            </a>
                        </li>
                    </ul>
                </div>
            </nav>

            <!-- 主内容区 -->
            <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4 content-area">
                {{template "content" .}}
            </main>
        </div>
    </div>

    <!-- 弹框容器 -->
    <div class="toast-container" id="toastContainer"></div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="/static/js/common.js"></script>
    {{if .jsFile}}
    <script src="/static/js/{{.jsFile}}"></script>
    {{end}}
</body>
</html>